package com.cjp.annotation;

import com.cjp.validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

@Documented
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {StateValidation.class})
public @interface State {
    // 错误信息
    String message() default "文章状态只能是草稿或已发布";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
